package cn.wen.bases.framework.struts.interceptor;

import cn.wen.bases.framework.struts.UtilsOfStruts;
import cn.wen.javax.servlet.http.UtilsOfResponse;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * Title：页面缓存不启用拦截器
 * <p>
 * Description：
 * <p>
 * Copyright：Copyright (c) 2010-2012
 * 
 * @author <a href="mailto:ct_wen@qq.com">ctwen</a>, 温承瑭
 * @version Revision：1.0 Date：2010/11/15 Description：初完成。
 *          <p>
 */
public class NoCacheInterceptor extends AbstractInterceptor {

    private static final long serialVersionUID = 5996978542435331882L;

    /**
     * <pre>
     * 不缓存HttpServletResponse。
     * </pre>
     * 
     * @see com.opensymphony.xwork2.interceptor.AbstractInterceptor#intercept(com.opensymphony.xwork2.ActionInvocation)
     */
    @Override
    public String intercept(ActionInvocation ai) throws Exception {
	UtilsOfResponse.setHeaderByNoCache(UtilsOfStruts.getHttpServletResponse());
	return ai.invoke();
    }

}
